import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    isCollapse: false,
    navmenulist:[],
    tagList: [],
    portlist: [
      {
        label: "后台",
        value: "0",
      },
      {
        label: "小程序",
        value: "1",
      },
      {
        label: "客户端",
        value: "2",
      },
      {
        label: "工厂小程序",
        value: "3",
      },
      {
        label: "工厂客户端",
        value: "4",
      },
      {
        label: "仓库客户端",
        value: "5",
      }
    ]
  },
  mutations: {
    mutationsIsCollapse(state) {
      state.isCollapse = !state.isCollapse
    },
    mutationsTagList(state,datas) {
      let tagList = state.tagList
      let istrue = tagList.some((value, index) => datas==value) 
      if(!istrue){
        tagList.push(datas)
        state.tagList = tagList
      }
    },
    mutationsNavMenuList(state,datas) {
        state.navmenulist = datas
    }
  },
  actions: {

  },
  modules: {
  }
})
